<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>管理员后台</title>
  <link rel="shortcut icon" href="/public/img/favicon.ico" type="image/x-icon" />
  <link rel="stylesheet" href="/node_modules/layui/dist/css/layui.css">
  <link rel="stylesheet" href="/node_modules/bootstrap/dist/css/bootstrap.css">
</head>

<body>
  <div class="layui-layout layui-layout-admin">
    <div class="layui-header">
      <div class="layui-logo" style="width: 165px;">管理员 {{ user.username }} </div>

      <ul class="layui-nav layui-layout-right">
        <li class="layui-nav-item">
          <a href="javascript:;">
            <img src="/public/img/head.jpg" class="layui-nav-img">
            {{ user.username }}
          </a>
        </li>
        <li class="layui-nav-item"><a href="/logout">注销</a></li>
      </ul>
    </div>

    <div class="layui-side layui-bg-black">
      <div class="layui-side-scroll">
        <ul class="layui-nav layui-nav-tree" lay-filter="test">
          <li class="layui-nav-item"><a href="/delSalesman">销售人员ID列表&删除</a></li>
          <li class="layui-nav-item"><a href="/addSalesman">销售人员ID增加&修改</a></li>
          <li class="layui-nav-item"><a href="/checkRecords">各类商品销售记录</a></li>
          <li class="layui-nav-item"><a href="/performance">各类商品销售业绩统计</a></li>
          <li class="layui-nav-item"><a href="/loginStatus">各类用户历史登录状态</a></li>
          <li class="layui-nav-item"><a href="/userPicture">用户画像</a></li>
        </ul>
      </div>
    </div>

    <div class="layui-body">
      <!-- 内容主体区域 -->
      <div style="padding: 15px;">
        <form id="salesman-form" action="/checkRecords" method="post" style="overflow: hidden;">
          <div class="form-group">
            <select name="type" id="selector" class="form-control">
              <option value="">请选择商品类别</option>
              <option value="0">全部</option>
              <option value="1">手机</option>
              <option value="2">家用电器</option>
              <option value="3">电脑办公</option>
              <option value="4">服装</option>
            </select>
          </div>

          <table class="layui-table">
            <colgroup>
              <col width="150">
              <col width="200">
              <col>
            </colgroup>
            <thead>
              <tr>
                <th>用户名</th>
                <th>商品id</th>
                <th>商品价格</th>
                <th>购买数量</th>
                <th>总价</th>
                <th>购买时间</th>
              </tr>
            </thead>
            <tbody>
              {{ each records }}
              <tr>
                <td>{{ $value.username }}</td>
                <td>{{ $value.productID }}</td>
                <td>{{ $value.price }}</td>
                <td>{{ $value.amount }}</td>
                <td>{{ $value.total }}</td>
                <td>{{ $value.date }}</td>
              </tr>
              {{ /each }}
            </tbody>
          </table>
      </div>
      </form>
    </div>
  </div>
  </div>
  <script src="/node_modules/jquery/dist/jquery.js"></script>
  <script>
    $('#selector').on('change',function(e){
      $('#salesman-form').submit()
    })
  </script>
</body>

</html>